using System;
namespace ICSharpCode.TextEditor.Gui.CompletionWindow
{
	public class DefaultCompletionData : ICompletionData
	{
		private string text;
		private string description;
		private int imageIndex;
		private double priority;
		public int ImageIndex
		{
			get
			{
				return this.imageIndex;
			}
		}
		public string Text
		{
			get
			{
				return this.text;
			}
			set
			{
				this.text = value;
			}
		}
		public virtual string Description
		{
			get
			{
				return this.description;
			}
		}
		public double Priority
		{
			get
			{
				return this.priority;
			}
			set
			{
				this.priority = value;
			}
		}
		public virtual bool InsertAction(TextArea textArea, char ch)
		{
			textArea.InsertString(this.text);
			return false;
		}
		public DefaultCompletionData(string text, int imageIndex)
		{
			this.text = text;
			this.imageIndex = imageIndex;
		}
		public DefaultCompletionData(string text, string description, int imageIndex)
		{
			this.text = text;
			this.description = description;
			this.imageIndex = imageIndex;
		}
		public static int Compare(ICompletionData a, ICompletionData b)
		{
			if (a == null)
			{
				throw new ArgumentNullException("a");
			}
			if (b == null)
			{
				throw new ArgumentNullException("b");
			}
			return string.Compare(a.Text, b.Text, StringComparison.InvariantCultureIgnoreCase);
		}
	}
}
